package com.baizhi.controller;


import com.baizhi.entity.Role;
import com.baizhi.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author haiyu
 * @since 2021-09-06
 */
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private IRoleService ir;

    @GetMapping("/selectAll")
    @PreAuthorize("hasAuthority('sys:schedule:list,sys:schedule:info')")
    public List<Role> selectAll(){
        List<Role> list = ir.list();
        return list;
    }


}

